@extends('app')
@section('content')
<div class="post">
	<form action="{{ url('archive') }}" method="post">
	{{ csrf_field() }}
	  <div class="form-group">
	    <label>Title</label>
	    <input type="text" class="form-control" name='title' placeholder="Title">
	  </div>
	  <div class="form-group">
	    <label>Content</label><br>
	    <textarea class="form-control" name="text" rows="20"></textarea>
	  </div>
	  <div class="form-group">
	    <label>Category</label><br>
	    <select name="category_id" class="form-control">
	    	@foreach ($categorys as $category)
	    	<option value="{{ $category->id }}">{{ $category->category_name }}</option>
	    	@endforeach
	    </select>
	  </div>
	  <input class="btn btn-primary form-group" type="submit" value="发布" style="float:right;">
	</form>
	<form id="uploadForm" method="post" action="http://upload.qiniu.com/"
	 enctype="multipart/form-data">
	  <input name="key" type="hidden">
	  <input name="token" type="hidden" value="{{ $uptoken }}">
	  <div class="form-group">
		<label for="exampleInputFile">添加图片</label>
	  	<input name="file" type="file" />
	  </div>
	</form>
</div>
	
@endsection